package com.dx.controller;

import com.dx.pojo.user.User;
import com.dx.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/user")
@RestController
public class UserController {
    @Autowired
    UserService service;

    @RequestMapping("/queryUserByUserName")
    public User queryUserByUserName(String username){

        return service.queryUserByUserName(username);
    }

    @RequestMapping("/addUser")
    public String addUser(User user){
        service.addUser(user);
        System.out.println(user);
        return "ok";
    }

}
